home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / Found / BCCollec / Structs / Stacks / BCStacU.h < prev   
Encoding:
Text File  |  1994-04-21  |  1.4 KB  |  54 lines  |  [TEXT/MPS ]

  1. //  The C++ Booch Components (Version 2.1)
  2. //  (C) Copyright 1990-1993 Grady Booch. All Rights Reserved.
  3. //
  4. //  BCStacU.h
  5. //
  6. //  This file contains the declaration of the unbounded stack.
  7.  
  8. #ifndef BCSTACU_H
  9. #define BCSTACU_H 1
  10.  
  11. #include "BCUnboun.h"
  12. #include "BCStac.h"
  13.  
  14. // Unbounded stack
  15.  
  16. template<class Item, class StorageManager>
  17. class BC_TUnboundedStack : public BC_TStack<Item> {
  18. public:
  19.  
  20.   BC_TUnboundedStack();
  21.   BC_TUnboundedStack(const BC_TUnboundedStack<Item, StorageManager>&);
  22.   virtual ~BC_TUnboundedStack();
  23.  
  24.   virtual BC_TStack<Item>& operator=(const BC_TStack<Item>&);
  25.   virtual BC_TStack<Item>& operator=(const BC_TUnboundedStack<Item, StorageManager>&);
  26.   virtual BC_Boolean operator==(const BC_TStack<Item>&) const;
  27.   virtual BC_Boolean operator==(const BC_TUnboundedStack<Item, StorageManager>&) const;
  28.   BC_Boolean operator!=(const BC_TUnboundedStack<Item, StorageManager>&) const;
  29.  
  30.   virtual void Clear();
  31.   virtual void Push(const Item&);
  32.   virtual void Pop();
  33.  
  34.   virtual BC_Index Depth() const;
  35.   virtual BC_Boolean IsEmpty() const;
  36.   virtual const Item& Top() const;
  37.   virtual Item& Top();
  38.  
  39.   static void* operator new(size_t);
  40.   static void operator delete(void*, size_t);
  41.  
  42. protected:
  43.  
  44.   BC_TUnbounded<Item, StorageManager> fRep;  
  45.  
  46.   virtual void Purge();
  47.   virtual void Add(const Item&);
  48.   virtual BC_Index Cardinality() const;
  49.   virtual const Item& ItemAt(BC_Index) const;
  50.  
  51. };
  52.  
  53. #endif
  54.